/* GUI CONVERTED from rchdate.i (converter v1.75) Tue Apr 10 12:04:19 2001 */
/* rchdate.i - Release Management Customer Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.2 $                                                         */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3          CREATED: 10/12/92      BY: WUG *G462*               */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98      BY: *K1Q4* Alfred Tan        */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00      BY: *N0KP* Mark Brown        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.3.1.2 $    BY: Jean Miller    DATE: 03/22/01 ECO: *P008*        */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* CALCULATE NON-HOLIDAY DUE OR RELEASE DATE FOR GIVEN DATE */

/************************************************************************
 *! {1} date
 *  {2} 1 = forwards   -1 = backwards
 *  {3} site
 *
 *  Note: This doesn't look for default calendar.
 *************************************************************************/

find shop_cal where
     shop_site = {3} and
     shop_wkctr = "" and
     shop_mch = ""
no-lock no-error.

if {1} <> ? and available shop_cal then do:

   do while can-find(hd_mstr where
                     hd_site = shop_site and
                     hd_date = {1})
      or shop_wdays[weekday({1}) ] = no:

      {1} = {1} + {2}.

   end.

end.
